package com.asymptote;

import javax.jdo.JDOHelper;
import javax.jdo.PersistenceManager;
import javax.jdo.PersistenceManagerFactory;

import com.asymptote.DataEntity;
import com.asymptote.MidObject;

public class DataUtil {
	private final static PersistenceManagerFactory pmf
		= JDOHelper.getPersistenceManagerFactory( "transactions-optional" );
	
	public static PersistenceManager getPersistenceManager() {
		return pmf.getPersistenceManager();
	}
	
	public static String getState( DataEntity de ) {
		return JDOHelper.getObjectState( de ).toString();
	}
	public static String getState( MidObject mo ) {
		return JDOHelper.getObjectState( mo.getEntity() ).toString();
	}
}
